package hcn.protocol.brandnew.dengji.jianyanyuyue;

import lombok.Data;
import javax.xml.bind.annotation.*;
import java.util.List;
import hcn.protocol.brandnew.BaseRequest;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import ctd.util.xml.jaxb.DateTimeAdapter;
import org.atag.sysrouter.annotation.DictionaryMapping;

import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;


/**
 * 检验预约申请项目查询-响应消息(成功) - ODS_02060001_SUC
 *
 * @author enjoyLife
 */
@Data
@XmlRootElement(name = "Data")
@XmlAccessorType(XmlAccessType.FIELD)
public class LabAppointRequestQueryResponse {

    /**
     * 患者基本信息
     */
    @XmlElement(name = "Patient")
    private Patient patient;
    /**
     * 就诊摘要
     */
    @XmlElement(name = "Visit")
    private Visit visit;
    /**
     * 申请单集合
     */
    @XmlElementWrapper(name = "LabRequests")
    @XmlElement(name = "LabRequest")
    private List<LabRequest> labRequests;

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class Patient {

        /**
         * 业务系统患者档案ID
         */
        @XmlElement(name = "SourcePatientId")
        private String sourcePatientId;
        /**
         * 业务系统患者档案类型
         */
        @XmlElement(name = "SourcePatientIdType")
        private String sourcePatientIdType;
        /**
         * 建档机构代码
         */
        @XmlElement(name = "AuthorOrganization")
        private String authorOrganization;
        /**
         * 身份证件号码
         */
        @XmlElement(name = "IdCard")
        private String idCard;
        /**
         * 身份证件类别代码
         */
        @XmlElement(name = "IdCardCode")
        @DictionaryMapping(id = "CV02_01_101")
        private String idCardCode;
        /**
         * 患者姓名
         */
        @XmlElement(name = "Name")
        private String name;
        /**
         * 性别代码
         */
        @XmlElement(name = "Sex")
        private String sex;
    }

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class Visit {

        /**
         * 就诊机构代码
         */
        @XmlElement(name = "VisitOrganization")
        private String visitOrganization;
        /**
         * 患者类型代码
         */
        @XmlElement(name = "PatientType")
        private String patientType;
        /**
         * 患者类型名称
         */
        @XmlElement(name = "PatientTypeName")
        private String patientTypeName;
        /**
         * 就诊卡类别代码
         */
        @XmlElement(name = "MedicalCardType")
        private String medicalCardType;
        /**
         * 就诊卡号
         */
        @XmlElement(name = "MedicalCardId")
        private String medicalCardId;
        /**
         * 禁止预约标识
         */
        @XmlElement(name = "ForbidFlag")
        private Boolean forbidFlag;
        /**
         * 禁止预约说明
         */
        @XmlElement(name = "ForbidDescribe")
        private String forbidDescribe;
    }

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class Item {

        /**
         * 检验项目代码
         */
        @XmlElement(name = "ItemCode")
        private String itemCode;
        /**
         * 检验项目名称
         */
        @XmlElement(name = "ItemName")
        private String itemName;
        /**
         * 标本类别代码
         */
        @XmlElement(name = "SampleTypeCode")
        private String sampleTypeCode;
        /**
         * 标本类别名称
         */
        @XmlElement(name = "SampleTypeName")
        private String sampleTypeName;
        /**
         * 计费标志
         */
        @XmlElement(name = "FeeStatus")
        private Boolean feeStatus;
        /**
         * 采样区编码
         */
        @XmlElement(name = "SampleCollectAreaId")
        private String sampleCollectAreaId;
        /**
         * 采样区名称
         */
        @XmlElement(name = "SampleCollectAreaName")
        private String sampleCollectAreaName;
        /**
         * 可预约标识
         */
        @XmlElement(name = "AppointsValid")
        private Byte appointsValid;
        /**
         * 预约说明事项
         */
        @XmlElement(name = "AppointsDescribe")
        private String appointsDescribe;
    }

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class LabRequest {

        /**
         * 检验申请单编号
         */
        @XmlElement(name = "RequestId")
        private String requestId;
        /**
         * 检验申请单状态
         */
        @XmlElement(name = "RequestStatus")
        private Byte requestStatus;
        /**
         * 检验开单渠道
         */
        @XmlElement(name = "RequestSource")
        private Byte requestSource;
        /**
         * 申请医师代码
         */
        @XmlElement(name = "RequestDoctor")
        private String requestDoctor;
        /**
         * 申请医生姓名
         */
        @XmlElement(name = "RequestDoctorName")
        private String requestDoctorName;
        /**
         * 申请科室代码
         */
        @XmlElement(name = "RequestDept")
        private String requestDept;
        /**
         * 申请科室名称
         */
        @XmlElement(name = "RequestDeptName")
        private String requestDeptName;
        /**
         * 申请时间
         */
        @XmlElement(name = "RequestDateTime")
        @XmlJavaTypeAdapter(DateTimeAdapter.class)
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date requestDateTime;
        /**
         * 申请项目集合
         */
        @XmlElementWrapper(name = "Items")
        @XmlElement(name = "Item")
        private List<Item> items;
    }

}
